- return unless can?(current_user, :remove_project, project)
- can_delay_project_deletions = License.feature_available?(:adjourned_deletion_for_projects_and_groups)
- delayed_deletion = project.adjourned_deletion_configured?
- delayed_date = delayed_deletion ? permanent_deletion_date(Time.now.utc).to_s : nil
- restore_help_path = help_page_path('user/project/settings/index', anchor: 'restore-a-project')
- merge_requests_count = Projects::AllMergeRequestsCountService.new(project).count
- issues_count = Projects::AllIssuesCountService.new(project).count
- forks_count = Projects::ForksCountService.new(project).count

- unless project.marked_for_deletion?
  .gl-bg-red-50.gl-inset-border-l-3-red-600.gl-py-5.gl-px-6
    %h4.gl-font-lg.gl-mt-0= _('Delete this project')
    - if delayed_deletion && can_delay_project_deletions
      = render 'projects/settings/marked_for_removal'
    - else
      %p= permanent_delete_message(project)

    - if delayed_deletion && project.feature_available?(:adjourned_deletion_for_projects_and_groups)
      #js-project-delayed-delete-button{ data: { restore_help_path: restore_help_path, delayed_deletion_date: delayed_date, form_path: project_path(project), confirm_phrase: delete_confirm_phrase(project), is_fork: project.forked?.to_s, issues_count: number_with_delimiter(issues_count), merge_requests_count: number_with_delimiter(merge_requests_count), forks_count: number_with_delimiter(forks_count), stars_count: number_with_delimiter(project.star_count) } }
    - else
      #js-project-delete-button{ data: { form_path: project_path(project), confirm_phrase: delete_confirm_phrase(project), is_fork: project.forked?.to_s, issues_count: number_with_delimiter(issues_count), merge_requests_count: number_with_delimiter(merge_requests_count), forks_count: number_with_delimiter(forks_count), stars_count: number_with_delimiter(project.star_count) } }
- else
  = render 'projects/settings/permanently_delete', project: project
